<?php
/**
 * @Author: anchen
 * @Date:   2017-05-17 20:08:23
 * @Last Modified by:   anchen
 * @Last Modified time: 2017-05-26 19:44:05
 */

//拒绝非法访问
defined('ACCESS_KEY9296')||exit('denied');

class conf {
    protected static $ins = null;
    protected $data = array();
    final protected function __construct(){
        include(ROOT.'include/config.inc.php');
        $this->data = $_CFG;

    }

    final protected function __clone(){

    }
    public static function getIns(){
        if(self::$ins instanceof self){
            return self::$ins;
        }
        else{
            self::$ins = new self();
            return self::$ins;
        }
    }

    //读取data类的信息
    public function __get($key){
        if(array_key_exists($key,$this->data)){
            return $this->data[$key];
        }
        else{
            return null;
        }
    }

    public function __set($key,$value){
        $this->data[$key] = $value;
    }
}

